package com.zhouyu.gamecommunity.controller;

import com.alibaba.fastjson.JSONObject;
import com.zhouyu.gamecommunity.entity.Game;
import com.zhouyu.gamecommunity.entity.PageData;
import com.zhouyu.gamecommunity.entity.Result;
import com.zhouyu.gamecommunity.service.GameService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/game")
public class GameController {

    @Resource
    private GameService gameService;

    @GetMapping("/getRecommendGameList")
    private Result<List<Game>> getRecommendGameList() throws InterruptedException {
        //Thread.sleep(5000);
        return gameService.getRecommendGameList();
    }

    @GetMapping("/getTop/{type}")
    private Result<List<Game>> getTopGameListByType(@PathVariable Integer type) {
        return gameService.getTopGameListByType(type);
    }
}
